package com.elangzhi.ssm.model;

import com.elangzhi.ssm.model.base.BaseModel;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class OrderFrom extends BaseModel {

    private Long id;

    /**
     *订单标题
     */
    private String title;

    /**
     *提交用户ID
     */
    private Long userId;

    /**
     *对应店铺ID
     */
    private Long shopId;

    /**
     *下单时间
     */
    private Date setTime;

    /**
     *订单简介
     */
    private String intro;

    /**
     *订单类型
     * 1，商品订单 默认
     */
    private Integer type;

    /**
     *支付类型
     */
    private String payType;

    /**
     *支付时间
     */
    private Date payTime;

    /**
     *支付信息
     */
    private String payInfo;

    /**
     *配送类型
     */
    private String sendType;

    /**
     *配送时间
     */
    private Date sendTime;

    /**
     *配送信息
     */
    private String sendInfo;

    /**
     *收货地址ID
     */
    private Long receiptAddressId;

    /**
     *类型：
     * 1， 已提交；
     * 2，已付款；
     * 3，已发货；
     * 4，已完成；
     * 5，已取消/已失效
     */
    private Integer status;

    /**
     * 订单总价
     */
    private BigDecimal price;

    //店铺名称
    private String shopName;
    private String userName;

    //店铺名称
    private String shopIcon;

    //前台传过来的商品列表
    private String goodsList;

    //后台获取的此订单的商品列表
    private List<OrderGoods> goodses;

    // 个人收货地址对象
    private ReceiptAddress address;

    public OrderFrom(Long id, String title, Long userId, Long shopId, Date setTime, String intro, Integer type, String payType, Date payTime, String payInfo, String sendType, Date sendTime, String sendInfo, Long receiptAddressId, Integer status) {
        this.id = id;
        this.title = title;
        this.userId = userId;
        this.shopId = shopId;
        this.setTime = setTime;
        this.intro = intro;
        this.type = type;
        this.payType = payType;
        this.payTime = payTime;
        this.payInfo = payInfo;
        this.sendType = sendType;
        this.sendTime = sendTime;
        this.sendInfo = sendInfo;
        this.receiptAddressId = receiptAddressId;
        this.status = status;
    }

    public OrderFrom() {

    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public ReceiptAddress getAddress() {
        return address;
    }

    public void setAddress(ReceiptAddress address) {
        this.address = address;
    }

    public String getShopIcon() {
        return shopIcon;
    }

    public void setShopIcon(String shopIcon) {
        this.shopIcon = shopIcon;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public List<OrderGoods> getGoodses() {
        return goodses;
    }

    public void setGoodses(List<OrderGoods> goodses) {
        this.goodses = goodses;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Date getSetTime() {
        return setTime;
    }

    public String getSetTime(String patt){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(patt);
        return simpleDateFormat.format(this.setTime);
    }

    public void setSetTime(Date setTime) {
        this.setTime = setTime;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getPayType() {
        return payType;
    }

    public void setPayType(String payType) {
        this.payType = payType;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public String getPayInfo() {
        return payInfo;
    }

    public void setPayInfo(String payInfo) {
        this.payInfo = payInfo;
    }

    public String getSendType() {
        return sendType;
    }

    public void setSendType(String sendType) {
        this.sendType = sendType;
    }

    public Date getSendTime() {
        return sendTime;
    }

    public void setSendTime(Date sendTime) {
        this.sendTime = sendTime;
    }

    public String getSendInfo() {
        return sendInfo;
    }

    public void setSendInfo(String sendInfo) {
        this.sendInfo = sendInfo;
    }

    public Long getReceiptAddressId() {
        return receiptAddressId;
    }

    public void setReceiptAddressId(Long receiptAddressId) {
        this.receiptAddressId = receiptAddressId;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public String getGoodsList() {
        return goodsList;
    }

    public void setGoodsList(String goodsList) {
        this.goodsList = goodsList;
    }
}